home *** CD-ROM | disk | FTP | other *** search
/ Especial Multimedia / Especial Multimedia.iso / Multimed / Prg / WAVPLUS.ZIP / MIDIINFO.WD_ / MIDIINFO.WD
Text File  |  1997-09-14  |  4KB  |  155 lines

  1. VERSION 2.00
  2. Begin Form MidiInfo 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Midi Info"
  6.    ClientHeight    =   1830
  7.    ClientLeft      =   1095
  8.    ClientTop       =   1485
  9.    ClientWidth     =   4590
  10.    ControlBox      =   0   'False
  11.    Height          =   2235
  12.    Left            =   1035
  13.    LinkTopic       =   "Form3"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   1830
  17.    ScaleWidth      =   4590
  18.    Top             =   1140
  19.    Width           =   4710
  20.    Begin Timer Timer1 
  21.       Enabled         =   0   'False
  22.       Interval        =   50
  23.       Left            =   4320
  24.       Top             =   1620
  25.    End
  26.    Begin CommandButton CmdPlay 
  27.       BackColor       =   &H00C0C0C0&
  28.       Caption         =   "&Play Midi"
  29.       Height          =   375
  30.       Left            =   240
  31.       TabIndex        =   3
  32.       Top             =   1260
  33.       Width           =   2055
  34.    End
  35.    Begin CommandButton CmdOkay 
  36.       BackColor       =   &H00C0C0C0&
  37.       Cancel          =   -1  'True
  38.       Caption         =   "O &K A Y"
  39.       Height          =   375
  40.       Left            =   2280
  41.       TabIndex        =   0
  42.       Top             =   1260
  43.       Width           =   2055
  44.    End
  45.    Begin Label Label2 
  46.       Alignment       =   1  'Right Justify
  47.       BackStyle       =   0  'Transparent
  48.       Caption         =   "Label2"
  49.       Height          =   195
  50.       Index           =   1
  51.       Left            =   2400
  52.       TabIndex        =   4
  53.       Top             =   720
  54.       Width           =   1935
  55.    End
  56.    Begin Label Label2 
  57.       Alignment       =   1  'Right Justify
  58.       BackStyle       =   0  'Transparent
  59.       Caption         =   "Label2"
  60.       Height          =   200
  61.       Index           =   0
  62.       Left            =   2400
  63.       TabIndex        =   5
  64.       Top             =   240
  65.       Width           =   1935
  66.    End
  67.    Begin Label Label1 
  68.       BackStyle       =   0  'Transparent
  69.       Caption         =   "Length in milliseconds:"
  70.       Height          =   195
  71.       Index           =   1
  72.       Left            =   240
  73.       TabIndex        =   2
  74.       Top             =   720
  75.       Width           =   2055
  76.    End
  77.    Begin Label Label1 
  78.       BackStyle       =   0  'Transparent
  79.       Caption         =   "File Name:"
  80.       Height          =   200
  81.       Index           =   0
  82.       Left            =   240
  83.       TabIndex        =   1
  84.       Top             =   240
  85.       Width           =   2055
  86.    End
  87. End
  88.  
  89. Sub CmdOkay_Click ()
  90.     RetString$ = Space$(255)
  91.     MidiStop RetString$
  92.     
  93.     RetString$ = Space$(255)
  94.     MidiClose RetString$
  95.     
  96.     Unload Me
  97. End Sub
  98.  
  99. Sub CmdPlay_Click ()
  100.     Answer$ = Space$(255)
  101.     MidiStatusMode Answer$
  102.     If Left$(Answer$, 7) = "playing" Then
  103.         RetString$ = Space$(255)
  104.         MidiClose RetString$
  105.         Timer1.Enabled = False
  106.         End If
  107.     
  108.     TheFileName$ = FormPassString
  109.     RetString$ = Space$(255)
  110.     MidiOpen TheFileName$, RetString$
  111.     RetString$ = Space$(255)
  112.     MidiStart RetString$
  113.     Timer1.Enabled = True
  114. End Sub
  115.  
  116. Sub Form_Load ()
  117.     FormCenterForm Me, WavPlay
  118.     
  119.     TempName$ = FormPassString
  120.     RevString TempName$
  121.     pos% = InStr(TempName$, "\")
  122.     TempName$ = Left$(TempName$, pos% - 1)
  123.     RevString TempName$
  124.     Label2(0).Caption = UCase$(TempName$)
  125.  
  126.     TheFileName$ = FormPassString
  127.     RetString$ = Space$(255)
  128.     MidiOpen TheFileName$, RetString$
  129.     RetString$ = Space$(255)
  130.     MidiStatusLengthMS RetString$
  131.     RetString$ = Format$(Val(RetString$), "###,###,##0")
  132.     Label2(1).Caption = RetString$
  133.     RetString$ = Space$(255)
  134.     MidiClose RetString$
  135.     
  136.     Screen.MousePointer = 0
  137. End Sub
  138.  
  139. Sub Form_Paint ()
  140.     DoForm3D Me, "raised", 2, 0
  141.     DoForm3D Me, "sunken", 2, 2
  142. End Sub
  143.  
  144. Sub Timer1_Timer ()
  145.     Answer$ = Space$(255)
  146.     MidiStatusMode Answer$
  147.     If Left$(Answer$, 7) = "playing" Then Exit Sub
  148.     If Left$(Answer$, 7) = "stopped" Then
  149.         RetString$ = Space$(255)
  150.         MidiClose RetString$
  151.         Timer1.Enabled = False
  152.         End If
  153. End Sub
  154.  
  155.